import re

# \d用法
# s = 'zhangsan 123 lisi 23 wangwu 9387'
# res = re.findall( r'\d+',s)
# print('res=',res)

# # \b用法
# s1 = 'cat1 catyou cat! i love cat'
# res1 = re.findall(r'cat\b',s1)
# print('res1=',res1)

# s = 'wwwxbaiduxcom www.baidu.com'
# res1 = re.findall('www.[a-z]*.com',s)
# print('res=',res1)
# res = re.findall(r'www\.[a-z]*\.com',s)
# print('res=',res)

# s = '*** ******* *****'
# res = re.findall(r'\*+',s)
# print('res=',res)

# s = r'\user\now\1.png,\user\now\b.png,\user\now\apple.png,\user\n.png'
# # 提取\user\now文件夹下的png文件
# res = re.findall(r'\\user\\now\\.+png',s)
# print('res=',res)

import re

s = r'\user\now\1.png,\user\now\b.png,\user\now\apple.png,\user\n.png'
# 使用非贪婪匹配，并且明确限定路径分隔符
res = re.findall(r'\\user\\now\\.+?\.png', s)
print('res=', res)